package oraclebd;

import java.sql.Connection;
import java.sql.SQLException;

import oracle.jdbc.pool.OracleDataSource;

public class ConexcaoPessoa {
	
	public ConexcaoPessoa() {
	}
	
	public Connection getConnection() {
		Connection c = null;
		
		try{
			OracleDataSource odbs = new OracleDataSource();
			
			String password = "@serra!";
			odbs.setUser("system");
			odbs.setPassword(password);
			odbs.setPortNumber(1521);
			odbs.setServiceName("xe");
			odbs.setDriverType("thin");
			odbs.setServerName("localhost");
//			System.out.println(odbs.getURL());
			
			c = odbs.getConnection();
		}
		catch(SQLException e){
			e.printStackTrace();
		}
		
		return c;
	}	
	
}
